<template>

	<!-- 高性能列表 -->
	<swiper @change="onChangeTab" circular :current="current" :duration="500">
		<swiper-item v-for="(item,index) in tabBarData" :key="index">
			<u-list>
				<u-list-item>
					<slot :scopd="item" :$index="index"></slot>
				</u-list-item>
			</u-list>
		</swiper-item>
	</swiper>



</template>

<script>
	export default {
		name: "c-scroll-view",
		data() {
			return {
				scrollH: 0,
			};
		},
		props: {
			// 选项卡类表数据
			tabBarData: {
				type: Array,
				default: () => []
			},
			// 选项卡切换下标
			current: {
				type: [Number, String],
				required: true,
				default: 0,
			},

		},
		created() {
			// 动态获取可使用屏幕高度 
			this.scrollH = uni.getSystemInfoSync().windowHeight

		},
		methods: {
			// 切换事件
			onChangeTab(e) {
				uni.$emit("onChangeTab", {
					current: e.target.current
				})
			}
		}
	}
</script>

<style>

</style>
